<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="org.yate.oa.model.PrivilegeEntity"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>

<script src="${ctx}/js/prototype.lite.js" type="text/javascript"></script>
<script src="${ctx}/js/moo.fx.js" type="text/javascript"></script>
<script src="${ctx}/js/moo.fx.pack.js" type="text/javascript"></script>
<style>
body {
	font: 12px Arial, Helvetica, sans-serif;
	color: #000;
	background-color: #EEF2FB;
	margin: 0px;
}

#container {
	width: 182px;
}

H1 {
	font-size: 12px;
	margin: 0px;
	width: 182px;
	cursor: pointer;
	height: 30px;
	line-height: 20px;
}

H1 a {
	display: block;
	width: 182px;
	color: #000;
	height: 30px;
	text-decoration: none;
	moz-outline-style: none;
	background-image: url(${ctx}/images/menu_bgS.gif);
	background-repeat: no-repeat;
	line-height: 30px;
	text-align: center;
	margin: 0px;
	padding: 0px;
}

.content {
	width: 182px;
	height: 26px;
}

.MM ul {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
	display: block;
}

.MM li {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 26px;
	color: #333333;
	list-style-type: none;
	display: block;
	text-decoration: none;
	height: 26px;
	width: 182px;
	padding-left: 0px;
}

.MM {
	width: 182px;
	margin: 0px;
	padding: 0px;
	left: 0px;
	top: 0px;
	right: 0px;
	bottom: 0px;
	clip: rect(0px, 0px, 0px, 0px);
}

.MM a:link {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 26px;
	color: #333333;
	background-image: url(${ctx}/images/menu_bg1.gif);
	background-repeat: no-repeat;
	height: 26px;
	width: 182px;
	display: block;
	text-align: center;
	margin: 0px;
	padding: 0px;
	overflow: hidden;
	text-decoration: none;
}

.MM a:visited {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 26px;
	color: #333333;
	background-image: url(${ctx}/images/menu_bg1.gif);
	background-repeat: no-repeat;
	display: block;
	text-align: center;
	margin: 0px;
	padding: 0px;
	height: 26px;
	width: 182px;
	text-decoration: none;
}

.MM a:active {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 26px;
	color: #333333;
	background-image: url(${ctx}/images/menu_bg1.gif);
	background-repeat: no-repeat;
	height: 26px;
	width: 182px;
	display: block;
	text-align: center;
	margin: 0px;
	padding: 0px;
	overflow: hidden;
	text-decoration: none;
}

.MM a:hover {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 26px;
	font-weight: bold;
	color: #006600;
	background-image: url(${ctx}/images/menu_bg2.gif);
	background-repeat: no-repeat;
	text-align: center;
	display: block;
	margin: 0px;
	padding: 0px;
	height: 26px;
	width: 182px;
	text-decoration: none;
}
</style>
<script type="text/javascript">
	var a = [{"name":'高压部分',"url":'/jsp/highVol/list.jsp','modId':'0'},
	         {"name":'高压开关柜',"url":'/jsp/highVolCabinet/list.jsp','modId':'0'},
	         {"name":'组合型地下式变压器',"url":'/jsp/transformer/combin/list.jsp','modId':'1'},
	         {"name":'配电型地下式变压器',"url":'/jsp/transformer/distributor/list.jsp','modId':'1'},
	         {"name":'断路器',"url":'/jsp/duanluqi/list.jsp','modId':'2'},
	         {"name":'表计',"url":'/jsp/biaoji/list.jsp','modId':'2'},
	         {"name":'电流互感器',"url":'/jsp/dlhgq/list.jsp','modId':'2'},
	         {"name":'避雷器',"url":'/jsp/blq/list.jsp','modId':'2'},
	         {"name":'交流接触器',"url":'/jsp/jljcq/list.jsp','modId':'2'},
	         {"name":'隔离开关',"url":'/jsp/glkg/list.jsp','modId':'2'},
	         {"name":'隔离开关熔断器组',"url":'/jsp/glkgrdqz/list.jsp','modId':'2'},
	         {"name":'电容器',"url":'/jsp/drq/list.jsp','modId':'2'},
	         {"name":'补偿控制器',"url":'/jsp/bckzq/list.jsp','modId':'2'},
	         {"name":'智能电容器',"url":'/jsp/zndrq/list.jsp','modId':'2'},
	         {"name":'元器件数量',"url":'/jsp/yqj/list.jsp','modId':'2'},
	         {"name":'图纸管理',"url":'/jsp/tzgl/list.jsp','modId':'3'}
	        ];
	var c = [0];
	var modlecount = 0;
	function test(){
// 		<c:forEach items="${role}" var="list">
// 			var b = {};
// 			b.name = "${list.privName}";
// 			b.url = "${list.privUrl}";
// 			b.modId = "${list.modId}";
// 			a.push(b);
// 		</c:forEach>
		
		for(var i=0;i<a.length;i++){
			var is = false;
			for(var j=0;j<c.length;j++){
				if(a[i].modId == c[j]){
					is = true;
					break;
				}
			}
			if(!is){
				c.push(a[i].modId);
			}
		}
		var str = "";
		for(var i=0;i<c.length;i++){
			var title = '';
			if(c[i]==0){
				title = '高压';
			}else if(c[i]==1){
				title = '变压器';
			}else if(c[i]==2){
				title = '低压';
			}else if(c[i]==3){
				title = '设备图纸';
			}
			str += '<h1 class="type">';
			str += '<a href="javascript:void(0)">'+title+'</a>';
			str += '</h1>';
			str += '<div class="content">';
			str += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
			str += '<tr>';
			str += '<td><img src="${ctx }/images/menu_topline.gif" width="182" height="5" /></td>';
			str += '</tr>';
			str += '</table>';
			str += '<ul class="MM">';
			for(var j=0;j<a.length;j++){
				if(c[i] == a[j].modId){
					str += '<li><a href="${ctx}'+a[j].url+'" target="main">'+a[j].name+'</a></li>';
				}
			}
			str += '</ul>';
			str += '</div>';
		}
		document.getElementById('container').innerHTML=str;
		show(0);
	}
	
</script>
</head>
<body onload="test()">
	<table width="100%" height="280" border="0" cellpadding="0"
		cellspacing="0" bgcolor="#EEF2FB">
		<tr>
			<td width="182" valign="top"><div id="container">
					
				</div> <script type="text/javascript">
					function show(index) {
						var contents = document
								.getElementsByClassName('content');
						var toggles = document.getElementsByClassName('type');

						var myAccordion = new fx.Accordion(toggles, contents, {
							opacity : true,
							duration : 400
						});
						myAccordion.showThisHideOpen(contents[index]);
					}
				</script></td>
		</tr>
	</table>
</body>
</html>
